import re

# 使用正则提取json字符串
def re_tran_string(content):
    # 使用正则表达式提取大括号内容
    pattern = r'\{.*?\}'
    # 匹配
    try:
        matches = re.findall(pattern, content, re.DOTALL)
        return matches[-1]
    except:
        return '{"index": 1,"text": " "}'


if __name__ == '__main__':
    content = "{json1} some text {nested} more text {json3}"
    res = re_tran_string(content)
    print(res)